package dao;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.Query;

import model.AreaInteresse;;

public class AreaDAO {
private EntityManager em;
	
	public AreaDAO(EntityManager em){
		this.em = em;
	}
	
	public void adicionarAreaDAO(AreaInteresse a){
		em.persist(a);
	}
	public void remove(AreaInteresse a) {
		AreaInteresse a1 = em.merge(a);
		em.remove(a1);		
	}
	public List<AreaInteresse> listar() {
		Query q = em.createQuery("select u from AreaInteresse u");
		return q.getResultList();
	}
}
